package org.qengine.controller;


import org.qengine.entity.PaperInfoEntity;
import org.qengine.service.AnalyzeService;
import org.qengine.vo.ClassAnlysVo;
import org.qengine.vo.StuInfoAnlysVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/analyze")
public class AnalyzeController {
    @Autowired
    private AnalyzeService analyzeService;

    // 分析学生总览信息
    @RequestMapping("/stuAnalyze/{stuID}")
    public StuInfoAnlysVo getStuInfoAnlys(@PathVariable Long stuID) {
        return analyzeService.getStuInfoAnlys(stuID);
    }

    // 分析学生每次考试答卷信息
    @GetMapping("/stuAnalyze/papers/{stuID}")
    public List<PaperInfoEntity> getStuPapers(@PathVariable Long stuID) {
        return analyzeService.getStuPapers(stuID);
    }

    // 分析班级信息
    @RequestMapping("/classAnalyze/{classID}")
    public ClassAnlysVo getClassAnlys(@PathVariable Long classID) {
        return analyzeService.getClassAnlys(classID);
    }

}
